package com.googlecode.horncomb.bean.paged;

import java.util.List;

import com.googlecode.horncomb.bean.paged.DefaultPagedList;

/**
 * 分页页面列表,数据源只存放当前页面的数据记录.
 * @author Daniel
 */
public class LimitPagedList<Type extends List<?>> extends DefaultPagedList<Type> {

	private static final long serialVersionUID = -5354247330566244161L;

	private int nrOfElements = 0;

	public LimitPagedList() {
		super();
	}

	public LimitPagedList(int page, int pageSize, int nrOfElements) {
		super(page, pageSize);
		this.nrOfElements = nrOfElements < 0 ? 0 : nrOfElements;
	}

	/**
	 * @see com.googlecode.horncomb.bean.paged.DefaultPagedList#getNrOfElements()
	 */
	@Override
	public int getNrOfElements() {
		return this.nrOfElements;
	}

	/**
	 * 设置元素记录条目数
	 * @param nrOfElements
	 */
	public void setNrOfElements(int nrOfElements) {
		this.nrOfElements = nrOfElements;
	}
}
